using ASP;
using HoWave.Common;
using HoWave.Web.Admin;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_Administrator : Admin, IRequiresSessionState
{
	private AdminBll _admin = null;
	protected LinkButton LinkButton3;
	protected GridView GridView1;
	protected AdminBll m_admin
	{
		get
		{
			AdminBll admin;
			if (this._admin == null)
			{
				this._admin = new AdminBll(this.conn);
				admin = this._admin;
			}
			else
			{
				admin = this._admin;
			}
			return admin;
		}
	}
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.admin.CheckSuperAdmin())
		{
			base.WriteLog("View", Language.GetAdminMsg("Log/Access", "0"), "Administrator");
			base.WriteRightErrMsg();
		}
		this.BindList();
	}
	protected void BindList()
	{
		this.GridView1.DataSource = this.m_admin.GetAllAdmin();
		this.GridView1.DataBind();
	}
	protected void DeleteAdmin(object sender, CommandEventArgs e)
	{
		int num = Convert.ToInt32(e.CommandName);
		if (num == base.admin.AdminID)
		{
			this.WriteErrMsg("", "不能删除自己！", "");
		}
		else
		{
			this.m_admin.DeleteAdmin(num);
			base.WriteLog("Delete", Language.GetAdminMsg("Log/ObjectID", num.ToString()), "Administrator");
		}
		this.BindList();
	}
	protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
	{
		e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#E7EDFE'");
		e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
	}
}
